package com.leadbank.springboot.example.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by jiangtianan on 2018/1/8.
 */
public interface UserRepository extends JpaRepository<User, Long> {

    User findByUsername(String username);

    User findByUsernameAndSex(String name, String sex);

    @Query("from User u where u.username=:username")
    User findUser(@Param("username") String username);
}
